home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / shell / smartfiles.lha / Inject.rex < prev    next >
OS/2 REXX Batch file  |  1995-09-29  |  882b  |  35 lines

  1. /* Asher's super-duper thingamajig - Version 1.1
  2.    Usage: rx ExnFile.rexx <filename>   */
  3. parse arg file
  4. command1 = '<before goes here>'
  5. command2 = '<after goes here>'
  6. command3 = '<in between goes here>'
  7. thefile = file
  8. outf2 = 'ram:out'     /* name of output file  */
  9. outf1 = outf2
  10. open(thefile,file, 'r')
  11. open(outf1, outf2, 'w')
  12. signal loop
  13. Loop:
  14. do while ~eof(thefile)
  15.  xx = readln(thefile)
  16.  xx = command1 xx command2
  17.  
  18. /* Note: if you want the in between command, remove the "*" and "/" from
  19.    the following line   */
  20.  
  21.  /* writeln(outf1, command3) */
  22.  writeln(outf1, xx)
  23.  end
  24.   close(thefile)
  25.   say 'Done!'
  26.   exit
  27.  else do
  28.   signal loop 
  29.  
  30. /* Note: if you want more than one "in between" command injected, you'll have
  31. to fiddle with the script.  Just put in a "writeIn(outf1, command<#)" for
  32. each in between line down at the bottom and inject it at the proper place up
  33. top.  */
  34.  
  35.